import React from 'react';

class Button extends React.Component {
  constructor() {
    super();
    this.state = {
      msg: '啦啦啦'
    };
  }

  render() {
    return (
      <div>
        <button
          onClick={() => {
            this.show();
          }}
        >
          click me
        </button>
      </div>
    );
  }

  show = () => {
    console.log(this.state.msg);
    this.setState({
      msg: '已经被修改了'
    }, () => {
      console.log(this.state.msg)
    });
  };
}

export default Button;
